package com.ican.domain.rule;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import com.ican.domain.common.BaseEntity;

@Entity
@Table(name="t_rule_category")
public class CategoryRule extends BaseEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    private String  url;
    private String  name;
    private String  code;
    private String  description;
    private Integer websiteId;
    private Integer ruleId;
    private Integer langId;
    private Date scanTime;
    private Integer scanStatus;//0： 未扫描；1：扫描中；2：扫描成功；3：扫描失败
    private String lastPageUrl;

    private WebsiteRule website;
    private ParseRule rule;

    @Column(name="url")
    public String getUrl() {
        return url;
    }
    public void setUrl(String url) {
        this.url = url;
    }
    @Column(name="name")
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    @Column(name="code")
    public String getCode() {
        return code;
    }
    public void setCode(String code) {
        this.code = code;
    }
    @Column(name="description")
    public String getDescription() {
        return description;
    }
    public void setDescription(String description) {
        this.description = description;
    }
    @Column(name="website_id")
    public Integer getWebsiteId() {
        return websiteId;
    }
    public void setWebsiteId(Integer websiteId) {
        this.websiteId = websiteId;
    }
    @Column(name="rule_id")
    public Integer getRuleId() {
        return ruleId;
    }
    public void setRuleId(Integer ruleId) {
        this.ruleId = ruleId;
    }
    @Column(name="lang_id")
    public Integer getLangId() {
        return langId;
    }
    public void setLangId(Integer langId) {
        this.langId = langId;
    }
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name = "scan_time", length = 19)
    public Date getScanTime() {
        return scanTime;
    }
    public void setScanTime(Date scanTime) {
        this.scanTime = scanTime;
    }
    @Column(name="scan_status")
    public Integer getScanStatus() {
        return scanStatus;
    }
    public void setScanStatus(Integer scanStatus) {
        this.scanStatus = scanStatus;
    }
    @Column(name="last_page_url")
    public String getLastPageUrl() {
        return lastPageUrl;
    }
    public void setLastPageUrl(String lastPageUrl) {
        this.lastPageUrl = lastPageUrl;
    }
    
    @Transient
    public WebsiteRule getWebsite() {
        return website;
    }
    public void setWebsite(WebsiteRule website) {
        this.website = website;
    }
    @Transient
    public ParseRule getRule() {
        return rule;
    }
    public void setRule(ParseRule rule) {
        this.rule = rule;
    }
}
